﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using LastLandClient.Data;

using Up2Link.SegString;

namespace LastLandClient.Core.CmdInterpreter
{
    public class CCmdTalk : ICommandInterpreter
    {
        public void ExecuteCommand(string _cmd, string _args)
        {
            if (_args != null)
            {
                CMessageSS talkMsg = new CMessageSS(CConst.CLIENT_MESSAGE_TALK, 0, CMessageSS.ENCODING_UTF32, _args);
                CData.client.Send(talkMsg);
            }
            else if (_args == null)
            {
                CData.console.SendOutput("talk指令接受一个参数");
            }
            else if (!CData.clientConnected)
            {
                CData.console.SendOutput("玩家尚未连接服务器");
            }
            else
            {
                CData.console.SendOutput("无效的指令");
            }
        }
    }
}
